package com.hn.gege.sys.modules.tt.dto;

import com.alibaba.excel.annotation.ExcelProperty;
import com.google.common.base.Converter;
import com.hn.gege.sys.modules.tt.entity.Tt;
import lombok.Data;
import org.springframework.beans.BeanUtils;

@Data
public class TtExcelDTO {

    private static final long serialVersionUID = 1L;

    @ExcelProperty(value = "主键", index = 0)
    private String id;

    @ExcelProperty(value = "姓名", index = 1)
    private String ttName;

    @ExcelProperty(value = "性别", index = 2)
    private String sex;

    @ExcelProperty(value = "高度", index = 3)
    private String height;



    public Tt convertToTt(){
        TtExcelDTOConver tDTO1Conver = new TtExcelDTOConver();
        Tt t1 = tDTO1Conver.doForward(this);
        return t1;
    }
    public TtExcelDTO convertFor(Tt t1){
        TtExcelDTOConver tDTO1Conver = new TtExcelDTOConver();
        TtExcelDTO tDTO1 = tDTO1Conver.doBackward(t1);
        return tDTO1;
    }
    
    public static class TtExcelDTOConver extends Converter<TtExcelDTO, Tt> {
    
        @Override
        protected Tt doForward(TtExcelDTO tDTO1) {
            Tt t1 = new Tt();
            BeanUtils.copyProperties(tDTO1, t1);
            return t1;
        }
    
        @Override
        protected TtExcelDTO doBackward(Tt t1) {
            TtExcelDTO tDTO1 = new TtExcelDTO();
            BeanUtils.copyProperties(t1, tDTO1);
            return tDTO1;
    
        }
    }
}
